package com.example.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;


/**
 * 注册VO
 * @author GuLin
 * @date 2021-06-29 19:30
 */
@Data
public class UserRegisterVo {

    @NotEmpty(message = "用户名称不能为空")
    @Length(min = 4,max = 20,message = "长度只能在4-20个字符之间")
    private String userName;
    @NotEmpty(message = "用户密码不能为空")
    @Length(min = 6,max = 20,message = "长度只能在6-20个字符之间")
    private String password;
    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "手机号格式不正确")
    private String phone;
    @NotEmpty(message = "验证码不能为空")
    private String code;
}
